<div id="main_organizations" class="span-24 last main">
    <div class="span-18">
        <div class="section_organizations_ads">
            <h2><?=$this->ad['title'] ?></h2>
            
            <div class="ad_excerpt_show">
            <?php  if (count ( $this->mensajes ) > 0) {
                        echo '<div class="success"><h2>';
                        foreach ( $this->mensajes as $msg ) {
                            echo $msg . '<br>';
                        }
                        echo '</h2></div>';
                    }
            ?>
            <?php
            if ($this->ad['photo'] !== null){
                echo '<div class="ad_list_image">
                    <a title="'.$this->translate('Click to enlarge photo').'" href="/images/uploads/ads/original/'.$this->ad['photo'].'" rel="superbox[image]">
                        <img alt="'.$this->ad['title'].'" src="/images/uploads/ads/100/'.$this->ad['photo'].'" /></a></div>';
            } else {
                echo '<div class="ad_list_image">';                 
                if ($this->lang == 'es') {
                    echo '<img alt="'.$this->ad['title'].'" src="/images/sin_imagen.jpg" /></div>';
                } else {
                    echo '<img alt="'.$this->ad['title'].'" src="/images/no_image.jpg" /></div>';
                }
            }
            ?>
                  
            <?php  // if you are the admin, then show edit link
            $auth = Zend_Auth::getInstance ();
            if ($auth->hasIdentity()):
                if ( ($this->ad['user_owner'] == $auth->getIdentity()->id)  || ($this->userRole == 1) ): ?>
                    <div class="edit_ad">
                        <a class="ads_section" href="/<?=$this->lang ?>/ad/orgedit/id/<?=$this->ad['id'] ?>">
                            <?=$this->translate('Edit this ad') ?></a>
                    </div><br />
            <?php endif; endif;?>
           
           <div class="ad_excerpt_title">
                <div class="ad_title"><h1><?=$this->ad['title'] ?></h1></div>
           </div>
           <span class="ad_url"><?=$this->translate('Website').':&nbsp;'?>
                <a class="ads_section" target="_blank" href="<?=$this->ad['url'] ?>"><?=$this->ad['url'] ?></a>
           </span>
           <span class="ad_date"><?=$this->translate('Posted on '). $this->escape(date( $this->translate('l dS \o\f F Y H:i:s'), strtotime($this->ad['date_created']))) ?><?=$this->translate('by user ') ?>
                <a class="ads_section" href="/<?=$this->lang ?>/ad/listorg/id/<?=$this->ad['user_owner'] ?>"><?=$this->escape($this->ad['username'] ) ?></a>
           </span>
           <div class="ad_body"><p><?php echo $this->ad['body'] ?></p></div>
                <div class="ad_meta_info">  
                     <div class="readings_count"><?=$this->countReadedAd['counter'] . ' ' .$this->translate('readings') ?></div>
                     <?php if ($this->checkCountAd): ?>
                             <div class="comments_count"><?=', '.$this->escape( $this->checkCountAd == null  ? 0 : $this->checkCountAd ).' '.$this->translate('comments') ?></div>
                      <?php endif;?>
                </div>
                
                <div class="sharelinks"><?=$this->translate('Share this ad:').'  ';?>
                    <table class="tablapostfooter" cellspacing="0" cellpadding="0">
                        <tr>
                            <td>
                            <!-- facebook -->
                                <fb:like expr:href="http://segundamanita.com/<?=$this->lang;?>/ad/show/id/<?=$this->ad['id'].'/'.$this->escape($this->ad['title'])?>" send="false" layout="button_count" show_faces="false" font="arial"></fb:like>
                                    </td>
                                    <td>
                                    <!-- email -->
                                        <a target="_blank" href="mailto:?subject=<?=$this->ad['title'];?>&body=http://segundamanita.com/<?=$this->lang;?>/ad/show/id/<?=$this->ad['id'].'/'.$this->escape($this->ad['title']);?>">
                                            <img alt="<?=$this->translate('Send by email');?>" src="/images/icons/ico_send_email.png" border = "0"/></a>
                                    </td>
                                    <td>
                                    <!-- Twitter -->
                                        <a href="https://twitter.com/share" class="twitter-share-button" 
                                           data-url="<?=$this->canonicalUrl ?>"
                                           data-counturl="<?=$this->canonicalUrl ?>"
                                           data-via="Segundamanita_"
                                           data-text="<?= $this->page_title ?>"
                                           data-count="horizontal"
                                           data-lang="es">Tweet</a>
                                    </td>
                                </tr>
                        </table>
                  </div>
                  <div class="clearer"></div>    
                  <div class="advertising">
                      	<!-- BEGIN PARTNER PROGRAM - DO NOT CHANGE THE PARAMETERS OF THE HYPERLINK -->
						<script language="javascript" type="text/javascript" src="http://program.epartner.es/view.asp?ref=570686&site=8346&type=html&hnb=13&js=1"></script>
						<noscript><a href="http://web.epartner.es/click.asp?ref=570686&site=8346&type=b1&bnb=1" target="_blank">
						<img src="http://program.epartner.es/view.asp?ref=570686&site=8346&b=1" border="0"/></a><br /></noscript>
						<!-- END PARTNER PROGRAM -->
                  </div>
                  <div class="clearer"></div>    
                  <? if ($this->ad['comments_enabled'] ): ?>
                    <? if ($this->comments ): ?>
                        <div class="ad_comments">
                            <h5><?=$this->translate ('Comments');?></h5>
                            
                                <?php foreach ($this->comments as $key => $val): ?>
                                    <div class="ad_comment">
                                        <span class="ad_date"><?=$this->translate('Posted on '). $this->escape($val['date_created']) ?>
                                        <?=$this->translate('by user ') ?>            
                                            <a class="ads_section" href="/<?=$this->lang ?>/profile/<?=$this->escape($val['username']) ?>"><?=$this->escape($val['username']) ?></a>
                                        </span>
                                        <div class="ad_body"><p><?php echo $this->escapeEmail( $this->escape($val['body']) ) ?></div>
                                    </div>
                                <?php endforeach; ?>
                        </div>
                    <?php endif;?>
                    <div class="comment_form"><?=$this->createcomment ?></div>
                  <?php endif;?>
                </div>
            </div>
        </div>

        <div class="span-6 last">
            <div class="advertising">
                <a href="/<?=$this->lang ?>/page/organizations">
                    <img alt="<?=$this->translate('Organizations and Campaigns') ?>" src="/images/organizations_banner.png" />
                </a>
            </div>
            <div class="clearer"></div>
            <?php // if you are admin, then show edit link
            if ($auth->hasIdentity()):
                if ( $this->userRole == 1 || $this->userRole == 2 ) { ?>
                    <div class="new_ad_icon">
                        <a class="new_ad" href="/<?=$this->lang ?>/ad/orgcreate">
                            <img alt="<?=$this->translate('Create new ad') ?>" src="/images/icons/ico_new_ad.png" class="valign" />
                            <div class="txt_valign"><?=$this->translate('Create new ad') ?></div>
                        </a>
                    </div> 
                     <div class="clearer"></div>
                <?php } ?>
            <?php endif; ?>         
            <div class="section_message">
                <h2><?php echo $this->translate('Interested?');?></h2>
                <div class="messageform">
                    <div class="content_section_message">
                        <div class="private_message_link"><?=$this->messageform ?></div>
                    </div>
                </div>
            </div>
            <div class="clearer"></div>      
            <div class="advertising">
                <!-- BEGIN PARTNER PROGRAM - DO NOT CHANGE THE PARAMETERS OF THE HYPERLINK -->
                <script language="javascript" type="text/javascript" src="http://program.epartner.es/view.asp?ref=570686&site=8346&type=html&hnb=6&js=1"></script>
                <noscript><a href="http://web.epartner.es/click.asp?ref=570686&site=8346&type=b1&bnb=1" target="_blank">
                <img src="http://program.epartner.es/view.asp?ref=570686&site=8346&b=1" border="0"/></a><br /></noscript>
                <!-- END PARTNER PROGRAM -->
            </div>
        </div>
</div> <!-- /main -->